<?php

class Application_Form_Login extends Zend_Form
{

    public function init() {
    	
    	$this->setAttribs(array(
			id=>"signupform"));
		$this->setDecorators(array(
			'FormElements',
			array('HtmlTag', array('tag' => 'table')),
			'Form',
		));
        $customElementDecorators = array(
            'ViewHelper',
			'Description',
            'Errors',
			array(array('data' => 'HtmlTag'),array('tag' => 'td')),
            array('Label', array('tag' => 'td','id'=>'zendlabel')),
			array(array('row'=>'HtmlTag'),array('tag'=>'tr')),
        );
    	//hidden input. The id information is for finding the user information easily. Match to user_id in database.
    	$uersId = $this->createElement("hidden","user_id");
    	
    	//user name, match to account in database.
	    $account = $this->createElement("text","account");
	    $account->setLabel("Email Account: ")
	    		->setRequired(true)
	    		->addValidator('EmailAddress')
                        ->setDecorators($customElementDecorators);
	    
	    //user password, match to password in database.
		$password = $this->createElement("password","password");
	    $password->setLabel("Password: ")->setRequired(true);
	    $password->setDecorators($customElementDecorators);

		//submit botton.
        $signin = $this->createElement("submit","signin");
        $signin->setLabel("Sign in")->setIgnore(true);
        $signin->setDecorators(array(
                    'ViewHelper',
                    array(array('data' => 'HtmlTag'), array('tag' => 'td')),
                    array(array('label' => 'HtmlTag'), array('tag' => 'td', 'placement' => 'prepend')),
                    array(array('row' => 'HtmlTag'), array('tag' => 'tr')),
        ));
		//transfer the data to action.
            $this->addElements(array($uersId,$account,$password,$signin,));
    }


}

